/*
 * SDLWindow.h
 *
 *  Created on: 24/05/2014
 *      Author: javier
 */

#ifndef SDLWINDOW_H_
#define SDLWINDOW_H_

#include <SDL2/SDL.h>
#include <SDL_ttf.h>
#include <string>
#include "Properties.h"

class SDLWindow {
public:
	SDLWindow();
	bool init();
	bool createWindow();
	bool createRenderer();
	SDL_Texture* loadTexture(std::string& filename);
	void renderTexture(SDL_Texture* tex, SDL_Rect *geometry, SDL_Rect* clip =
	NULL);
	void renderTexture(SDL_Texture* tex, int x, int y, SDL_Rect *clip = NULL);
	void clear();
	void renderPresent();
	SDL_Texture* renderText(const std::string &message, SDL_Color color);
	virtual ~SDLWindow();
private:
	SDL_Window *window;
	SDL_Renderer *renderer;
	Properties properties;
	TTF_Font *font;
};

#endif /* SDLWINDOW_H_ */
